Change in openvpn[master]: win32: ensure plugin dir has the trailing slash
A message that is not in the archive (sent off-list or not yet received): gerrit.1761818969000.I5ea90594493ab5cb858f7495f773e080b379e8e8@...2715...
Attention is currently required from: flichtenheld, plaisthos.
Hello plaisthos, flichtenheld,
I'd like you to do a code review.
Please visit
http://gerrit.openvpn.net/c/openvpn/+/1332?usp=email
to review the following change.
Change subject: win32: ensure plugin dir has the trailing slash
......................................................................
win32: ensure plugin dir has the trailing slash
This prevents loading plugins from the directories which share initial characters with the trusted path.
---
M CMakeLists.txt
M src/openvpn/win32.c
2 files changed, 29 insertions(+), 11 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/32/1332/1
CMakeLists.txt +4 -1
@@ -245,6 +245,9 @@ check_symbol_exists(chsize io.h HAVE_CHSIZE) check_symbol_exists(getrlimit sys/resource.h HAVE_GETRLIMIT) +# Some old versions of mingw does not have PATHCCH_OPTIONS enums -- add a check +check_symbol_exists(PATHCCH_ENSURE_TRAILING_SLASH pathcch.h HAVE_PATHCCH_ENSURE_TRAILING_SLASH) + # Some OS (e.g. FreeBSD) need some basic headers to allow # including network headers set(NETEXTRA sys/types.h)
@@ -338,7 +341,7 @@ if (WIN32) target_link_libraries(${target} PUBLIC ws2_32.lib crypt32.lib fwpuclnt.lib iphlpapi.lib - wininet.lib setupapi.lib rpcrt4.lib wtsapi32.lib ncrypt.lib bcrypt.lib) + wininet.lib setupapi.lib rpcrt4.lib wtsapi32.lib ncrypt.lib bcrypt.lib pathcch.lib) endif () endif ()
src/openvpn/win32.c +25 -10
@@ -51,6 +51,12 @@#include "wfp_block.h" +#include <pathcch.h> + +#ifndef HAVE_PATHCCH_ENSURE_TRAILING_SLASH +#define PATHCCH_ENSURE_TRAILING_SLASH 0x20 +#endif +/* * WFP handle */
@@ -1552,12 +1558,12 @@return false; } -WCHAR plugin_dir[MAX_PATH ] = {0 }; +WCHAR plugin_dir_reg[MAX_PATH ] = {0 };/* Attempt to retrieve the trusted plugin directory path from the registry, * using installation path as a fallback */ -if (!get_openvpn_reg_value (L"plugin_dir" , plugin_dir,_countof (plugin_dir)) - && !get_openvpn_reg_value (NULL , plugin_dir,_countof (plugin_dir))) +if (!get_openvpn_reg_value (L"plugin_dir" , plugin_dir_reg,_countof (plugin_dir_reg)) + && !get_openvpn_reg_value (NULL , plugin_dir_reg,_countof (plugin_dir_reg))) {msg (M_WARN ,"Installation path could not be determined." ); }
@@ -1569,26 +1575,35 @@msg (M_NONFATAL |M_ERRNO ,"Failed to get system directory." ); } -if ((wcslen (plugin_dir) ==0 ) && (wcslen (system_dir) ==0 )) +if ((wcslen (plugin_dir_reg) ==0 ) && (wcslen (system_dir) ==0 )) {return false; } -WCHAR normalized_plugin_dir[MAX_PATH ] = {0 }; +WCHAR plugin_dir[MAX_PATH ] = {0 }; -/* Normalize the plugin dir */ -if (wcslen (plugin_dir) >0 ) +/* normalize and canonicalize the plugin dir and add trailing slash */ +if (wcslen (plugin_dir_reg) >0 ) { -if (!GetFullPathNameW (plugin_dir,MAX_PATH , normalized_plugin_dir,NULL )) +WCHAR normalized_plugin_dir[MAX_PATH ] = {0 }; +if (!GetFullPathNameW (plugin_dir_reg,MAX_PATH , normalized_plugin_dir,NULL )) {msg (M_NONFATAL |M_ERRNO ,"Failed to normalize plugin dir." ); + } + +HRESULT res =PathCchCanonicalizeEx (plugin_dir,_countof (plugin_dir), normalized_plugin_dir, +PATHCCH_ENSURE_TRAILING_SLASH ); +if (res !=S_OK ) + { +/* doc says we cannot rely on GetLastError() */ +msg (M_NONFATAL ,"Failed to canonicalize plugin dir." );return false; } }/* Check if the plugin path resides within the plugin/install directory */ -if ((wcslen (normalized_plugin_dir) >0 ) - && (wcsnicmp (normalized_plugin_dir, plugin_path,wcslen (normalized_plugin_dir)) ==0 )) +if ((wcslen (plugin_dir) >0 ) + && (wcsnicmp (plugin_dir, plugin_path,wcslen (plugin_dir)) ==0 )) {return true; }
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1332?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I5ea90594493ab5cb858f7495f773e080b379e8e8
Gerrit-Change-Number: 1332
Gerrit-PatchSet: 1
Gerrit-Owner: stipa <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Attention is currently required from: flichtenheld, plaisthos, stipa.
cron2 has posted comments on this change by stipa. ( http://gerrit.openvpn.net/c/openvpn/+/1332?usp=email )
Change subject: win32: ensure plugin dir has the trailing slash
......................................................................
Patch Set 1: Code-Review-2
(1 comment)
Patchset:
PS1:
this breaks autoconf/automake compilation because the new library is not added to src/openvpn/Makefile.am
``` if WIN32 openvpn_SOURCES += openvpn_win32_resources.rc wfp_block.c wfp_block.h openvpn_LDADD += -lgdi32 -lws2_32 -lwininet -lcrypt32 -liphlpapi -lwinmm -lfwpuc lnt -lrpcrt4 -lncrypt -lsetupapi -lbcrypt endif ```
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1332?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I5ea90594493ab5cb858f7495f773e080b379e8e8
Gerrit-Change-Number: 1332
Gerrit-PatchSet: 1
Gerrit-Owner: stipa <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Attention: stipa <[email protected]...>
Gerrit-Comment-Date: Thu, 30 Oct 2025 19:32:26 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Attention is currently required from: flichtenheld, plaisthos, stipa.
Hello cron2, flichtenheld, plaisthos,
I'd like you to reexamine a change. Please visit
http://gerrit.openvpn.net/c/openvpn/+/1332?usp=email
to look at the new patch set (#2).
Change subject: win32: ensure plugin dir has the trailing slash
......................................................................
win32: ensure plugin dir has the trailing slash
This prevents loading plugins from the directories which share initial characters with the trusted path.
---
M CMakeLists.txt
M src/openvpn/Makefile.am
M src/openvpn/win32.c
3 files changed, 30 insertions(+), 12 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/32/1332/2
CMakeLists.txt +4 -1
@@ -245,6 +245,9 @@ check_symbol_exists(chsize io.h HAVE_CHSIZE) check_symbol_exists(getrlimit sys/resource.h HAVE_GETRLIMIT) +# Some old versions of mingw does not have PATHCCH_OPTIONS enums -- add a check +check_symbol_exists(PATHCCH_ENSURE_TRAILING_SLASH pathcch.h HAVE_PATHCCH_ENSURE_TRAILING_SLASH) + # Some OS (e.g. FreeBSD) need some basic headers to allow # including network headers set(NETEXTRA sys/types.h)
@@ -338,7 +341,7 @@ if (WIN32) target_link_libraries(${target} PUBLIC ws2_32.lib crypt32.lib fwpuclnt.lib iphlpapi.lib - wininet.lib setupapi.lib rpcrt4.lib wtsapi32.lib ncrypt.lib bcrypt.lib) + wininet.lib setupapi.lib rpcrt4.lib wtsapi32.lib ncrypt.lib bcrypt.lib pathcch.lib) endif () endif ()
src/openvpn/Makefile.am +1 -1
@@ -166,5 +166,5 @@ $(OPTIONAL_INOTIFY_LIBS) if WIN32 openvpn_SOURCES += openvpn_win32_resources.rc wfp_block.c wfp_block.h -openvpn_LDADD += -lgdi32 -lws2_32 -lwininet -lcrypt32 -liphlpapi -lwinmm -lfwpuclnt -lrpcrt4 -lncrypt -lsetupapi -lbcrypt +openvpn_LDADD += -lgdi32 -lws2_32 -lwininet -lcrypt32 -liphlpapi -lwinmm -lfwpuclnt -lrpcrt4 -lncrypt -lsetupapi -lbcrypt -lpathcch endif
src/openvpn/win32.c +25 -10
@@ -51,6 +51,12 @@#include "wfp_block.h" +#include <pathcch.h> + +#ifndef HAVE_PATHCCH_ENSURE_TRAILING_SLASH +#define PATHCCH_ENSURE_TRAILING_SLASH 0x20 +#endif +/* * WFP handle */
@@ -1553,12 +1559,12 @@return false; } -WCHAR plugin_dir[MAX_PATH ] = {0 }; +WCHAR plugin_dir_reg[MAX_PATH ] = {0 };/* Attempt to retrieve the trusted plugin directory path from the registry, * using installation path as a fallback */ -if (!get_openvpn_reg_value (L"plugin_dir" , plugin_dir,_countof (plugin_dir)) - && !get_openvpn_reg_value (NULL , plugin_dir,_countof (plugin_dir))) +if (!get_openvpn_reg_value (L"plugin_dir" , plugin_dir_reg,_countof (plugin_dir_reg)) + && !get_openvpn_reg_value (NULL , plugin_dir_reg,_countof (plugin_dir_reg))) {msg (M_WARN ,"Installation path could not be determined." ); }
@@ -1570,26 +1576,35 @@msg (M_NONFATAL |M_ERRNO ,"Failed to get system directory." ); } -if ((wcslen (plugin_dir) ==0 ) && (wcslen (system_dir) ==0 )) +if ((wcslen (plugin_dir_reg) ==0 ) && (wcslen (system_dir) ==0 )) {return false; } -WCHAR normalized_plugin_dir[MAX_PATH ] = {0 }; +WCHAR plugin_dir[MAX_PATH ] = {0 }; -/* Normalize the plugin dir */ -if (wcslen (plugin_dir) >0 ) +/* normalize and canonicalize the plugin dir and add trailing slash */ +if (wcslen (plugin_dir_reg) >0 ) { -if (!GetFullPathNameW (plugin_dir,MAX_PATH , normalized_plugin_dir,NULL )) +WCHAR normalized_plugin_dir[MAX_PATH ] = {0 }; +if (!GetFullPathNameW (plugin_dir_reg,MAX_PATH , normalized_plugin_dir,NULL )) {msg (M_NONFATAL |M_ERRNO ,"Failed to normalize plugin dir." ); + } + +HRESULT res =PathCchCanonicalizeEx (plugin_dir,_countof (plugin_dir), normalized_plugin_dir, +PATHCCH_ENSURE_TRAILING_SLASH ); +if (res !=S_OK ) + { +/* doc says we cannot rely on GetLastError() */ +msg (M_NONFATAL ,"Failed to canonicalize plugin dir." );return false; } }/* Check if the plugin path resides within the plugin/install directory */ -if ((wcslen (normalized_plugin_dir) >0 ) - && (wcsnicmp (normalized_plugin_dir, plugin_path,wcslen (normalized_plugin_dir)) ==0 )) +if ((wcslen (plugin_dir) >0 ) + && (wcsnicmp (plugin_dir, plugin_path,wcslen (plugin_dir)) ==0 )) {return true; }
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1332?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I5ea90594493ab5cb858f7495f773e080b379e8e8
Gerrit-Change-Number: 1332
Gerrit-PatchSet: 2
Gerrit-Owner: stipa <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Attention: stipa <[email protected]...>
Attention is currently required from: cron2, flichtenheld, plaisthos.
stipa has posted comments on this change by stipa. ( http://gerrit.openvpn.net/c/openvpn/+/1332?usp=email )
Change subject: win32: ensure plugin dir has the trailing slash
......................................................................
Patch Set 2:
(2 comments)
Patchset:
PS1:
Quoted 1 line
this breaks autoconf/automake compilation because the new library is not added to src/openvpn/Makefi […]
Done
Patchset:
PS2:
Fixed!
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1332?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I5ea90594493ab5cb858f7495f773e080b379e8e8
Gerrit-Change-Number: 1332
Gerrit-PatchSet: 2
Gerrit-Owner: stipa <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: cron2 <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Fri, 31 Oct 2025 11:34:06 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: cron2 <[email protected]...>
Attention is currently required from: flichtenheld, plaisthos, stipa.
cron2 has posted comments on this change by stipa. ( http://gerrit.openvpn.net/c/openvpn/+/1332?usp=email )
Change subject: win32: ensure plugin dir has the trailing slash
......................................................................
Patch Set 2: Code-Review+2
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1332?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I5ea90594493ab5cb858f7495f773e080b379e8e8
Gerrit-Change-Number: 1332
Gerrit-PatchSet: 2
Gerrit-Owner: stipa <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Attention: stipa <[email protected]...>
Gerrit-Comment-Date: Fri, 14 Nov 2025 21:29:20 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
PATCH v2 1/1 win32: ensure plugin dir has the trailing slash
In reply to a message not in the archiveFrom: Lev Stipakov <[email protected]...>
This prevents loading plugins from the directories which share initial characters with the trusted path.
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1332
---
This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1332
This mail reflects revision 2 of this Change.
Acked-by according to Gerrit (reflected above):
Gert Doering <[email protected]...>
CMakeLists.txt +4 -1
@@ -245,6 +245,9 @@ check_symbol_exists(chsize io.h HAVE_CHSIZE) check_symbol_exists(getrlimit sys/resource.h HAVE_GETRLIMIT) +# Some old versions of mingw does not have PATHCCH_OPTIONS enums -- add a check +check_symbol_exists(PATHCCH_ENSURE_TRAILING_SLASH pathcch.h HAVE_PATHCCH_ENSURE_TRAILING_SLASH) + # Some OS (e.g. FreeBSD) need some basic headers to allow # including network headers set(NETEXTRA sys/types.h)
@@ -338,7 +341,7 @@ if (WIN32) target_link_libraries(${target} PUBLIC ws2_32.lib crypt32.lib fwpuclnt.lib iphlpapi.lib - wininet.lib setupapi.lib rpcrt4.lib wtsapi32.lib ncrypt.lib bcrypt.lib) + wininet.lib setupapi.lib rpcrt4.lib wtsapi32.lib ncrypt.lib bcrypt.lib pathcch.lib) endif () endif ()
src/openvpn/Makefile.am +1 -1
@@ -166,5 +166,5 @@ $(OPTIONAL_INOTIFY_LIBS) if WIN32 openvpn_SOURCES += openvpn_win32_resources.rc wfp_block.c wfp_block.h -openvpn_LDADD += -lgdi32 -lws2_32 -lwininet -lcrypt32 -liphlpapi -lwinmm -lfwpuclnt -lrpcrt4 -lncrypt -lsetupapi -lbcrypt +openvpn_LDADD += -lgdi32 -lws2_32 -lwininet -lcrypt32 -liphlpapi -lwinmm -lfwpuclnt -lrpcrt4 -lncrypt -lsetupapi -lbcrypt -lpathcch endif
src/openvpn/win32.c +25 -10
@@ -51,6 +51,12 @@#include "wfp_block.h" +#include <pathcch.h> + +#ifndef HAVE_PATHCCH_ENSURE_TRAILING_SLASH +#define PATHCCH_ENSURE_TRAILING_SLASH 0x20 +#endif +/* * WFP handle */
@@ -1553,12 +1559,12 @@return false; } -WCHAR plugin_dir[MAX_PATH ] = {0 }; +WCHAR plugin_dir_reg[MAX_PATH ] = {0 };/* Attempt to retrieve the trusted plugin directory path from the registry, * using installation path as a fallback */ -if (!get_openvpn_reg_value (L"plugin_dir" , plugin_dir,_countof (plugin_dir)) - && !get_openvpn_reg_value (NULL , plugin_dir,_countof (plugin_dir))) +if (!get_openvpn_reg_value (L"plugin_dir" , plugin_dir_reg,_countof (plugin_dir_reg)) + && !get_openvpn_reg_value (NULL , plugin_dir_reg,_countof (plugin_dir_reg))) {msg (M_WARN ,"Installation path could not be determined." ); }
@@ -1570,26 +1576,35 @@msg (M_NONFATAL |M_ERRNO ,"Failed to get system directory." ); } -if ((wcslen (plugin_dir) ==0 ) && (wcslen (system_dir) ==0 )) +if ((wcslen (plugin_dir_reg) ==0 ) && (wcslen (system_dir) ==0 )) {return false; } -WCHAR normalized_plugin_dir[MAX_PATH ] = {0 }; +WCHAR plugin_dir[MAX_PATH ] = {0 }; -/* Normalize the plugin dir */ -if (wcslen (plugin_dir) >0 ) +/* normalize and canonicalize the plugin dir and add trailing slash */ +if (wcslen (plugin_dir_reg) >0 ) { -if (!GetFullPathNameW (plugin_dir,MAX_PATH , normalized_plugin_dir,NULL )) +WCHAR normalized_plugin_dir[MAX_PATH ] = {0 }; +if (!GetFullPathNameW (plugin_dir_reg,MAX_PATH , normalized_plugin_dir,NULL )) {msg (M_NONFATAL |M_ERRNO ,"Failed to normalize plugin dir." ); + } + +HRESULT res =PathCchCanonicalizeEx (plugin_dir,_countof (plugin_dir), normalized_plugin_dir, +PATHCCH_ENSURE_TRAILING_SLASH ); +if (res !=S_OK ) + { +/* doc says we cannot rely on GetLastError() */ +msg (M_NONFATAL ,"Failed to canonicalize plugin dir." );return false; } }/* Check if the plugin path resides within the plugin/install directory */ -if ((wcslen (normalized_plugin_dir) >0 ) - && (wcsnicmp (normalized_plugin_dir, plugin_path,wcslen (normalized_plugin_dir)) ==0 )) +if ((wcslen (plugin_dir) >0 ) + && (wcsnicmp (plugin_dir, plugin_path,wcslen (plugin_dir)) ==0 )) {return true; }
Attention is currently required from: flichtenheld, plaisthos, stipa.
cron2 has posted comments on this change by stipa. ( http://gerrit.openvpn.net/c/openvpn/+/1332?usp=email )
Change subject: win32: ensure plugin dir has the trailing slash
......................................................................
Patch Set 2: Code-Review-2
(1 comment)
Patchset:
PS2:
This is a bit annoying, with the back and forth of PATHCCH_ENSURE_TRAILING_SLASH in the iservice, we actually lost the configure.ac block that tests for it again, in commit 763160a16a. So this can't go in as it is.
So I do wonder if it makes more sense to have a manual check + strcat() on normalized_plugin_dir instead? Since this is already normalized via GetFullPathNameW(), bringing in the new API just for the last character really is a bit heavy...
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1332?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I5ea90594493ab5cb858f7495f773e080b379e8e8
Gerrit-Change-Number: 1332
Gerrit-PatchSet: 2
Gerrit-Owner: stipa <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Attention: stipa <[email protected]...>
Gerrit-Comment-Date: Sat, 15 Nov 2025 16:49:27 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Attention is currently required from: flichtenheld, plaisthos, stipa.
selvanair has posted comments on this change by stipa. ( http://gerrit.openvpn.net/c/openvpn/+/1332?usp=email )
Change subject: win32: ensure plugin dir has the trailing slash
......................................................................
Patch Set 2:
(2 comments)
Patchset:
PS2:
Quoted 1 line
This is a bit annoying, with the back and forth of
PATHCCH_ENSURE_TRAILING_SLASHin the iservice, […]
A work around is to use PathCchAddBackslash() followed by PathCchCanonicalize() avoiding the dependence on the PATHCCH_ENSURE_TRAILING_SLASH flag.
File src/openvpn/win32.c:
http://gerrit.openvpn.net/c/openvpn/+/1332/comment/3384bb13_c17698f4?usp=email :
PS2, Line 1607: && (wcsnicmp(plugin_dir, plugin_path, wcslen(plugin_dir)) == 0))
Is the logic right here? We are canonicalizing plugin_dir, but not plugin_path. Are we sure plugin_path cannot not contain "../"? The latter being user supplied, its more important to canonicalize it than the path read from HKLM.
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1332?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I5ea90594493ab5cb858f7495f773e080b379e8e8
Gerrit-Change-Number: 1332
Gerrit-PatchSet: 2
Gerrit-Owner: stipa <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-CC: selvanair <[email protected]...>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Attention: stipa <[email protected]...>
Gerrit-Comment-Date: Sat, 15 Nov 2025 17:16:53 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: cron2 <[email protected]...>